package com.jzo2o.customer.controller.operation;


import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.domain.WorkerCertificationAudit;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 服务人员认证审核表 前端控制器
 * </p>
 *
 * @author itlxc
 * @since 2024-10-14
 */
@RestController("operationWorkerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@RequiredArgsConstructor
@Api(tags = "服务人员认证审核相关接口")
@Slf4j
public class WorkerCertificationAuditController {

    private final IWorkerCertificationAuditService workerCertificationAuditService;

    @GetMapping("/page")
    @ApiOperation("审核服务人员认证分页查询")
    public PageResult<WorkerCertificationAudit> pageQuery(WorkerCertificationAuditPageQueryReqDTO dto) {
        log.info("审核服务人员认证分页查询参数：{}", dto);
        return workerCertificationAuditService.pageQuery(dto);
    }

    @PutMapping("/audit/{id}")
    @ApiOperation("审核服务人员认证信息")
    public void audit(@PathVariable("id") Long id, Integer certificationStatus, String rejectReason) {
        log.info("审核服务人员认证信息参数：{}, {}, {}", id, certificationStatus, rejectReason);
        workerCertificationAuditService.audit(id, certificationStatus, rejectReason);
    }
}
